-- GENERATED SPELL FOR [Engineer Whirleygig] --


function spell0_5836(pUnit, Event) --@Compact Harvest Reaper,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(7979,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_5836', 1, 1)
end

function spell1_5836(pUnit, Event) --@Explosive Sheep,Self--
pUnit:FullCastSpellOnTarget(8209,pUnit)
pUnit:RegisterEvent('Sorts_5836', 2000, 1)
end

function Sorts_5836(pUnit, Event)
local choix_sorts_5836 = math.random(0, 1)
if choix_sorts_5836 == 0 then
pUnit:RegisterEvent('spell0_5836', 1, 1)
end
if choix_sorts_5836 == 1 then
pUnit:RegisterEvent('spell1_5836', 1, 1)
end
end

function mob5836_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_5836', math.random(1500, 3000), 1)
end

function mob5836_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5836_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5836_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(5836, 1, 'mob5836_Action')
RegisterUnitEvent(5836, 2, 'mob5836_Leave')
RegisterUnitEvent(5836, 3, 'mob5836_Kill')
RegisterUnitEvent(5836, 4, 'mob5836_Die')
